package output

import (
	"github.com/go-kit/kit/log"
	"github.com/prometheus/alertmanager/config"
	es "github.com/prometheus/alertmanager/output/elastic"
)

//OutputsPoint store alarm events to elastic
// ZA: store alarm events
func OutputsPoint(ops []*config.Outputs, logger log.Logger) {
	for _, op := range ops {
		switch op.Name {
		case "es":
			es.NewClient(op.Hosts, op.User, op.Password, logger)
		}
	}
}

// EndPoint select output backend
func EndPoint(field map[string]interface{}) {
	if es.ElasticOutput.Enable {
		es.ElasticOutput.Output(field)
	}
}
